package edu.software.cakehomework.dao;

import edu.software.cakehomework.entity.Cake;
import edu.software.cakehomework.entity.Type;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List;

public interface CakeRepository extends JpaRepository<Cake, Integer> {
    Page<Cake> findByType(Type type, Pageable pageable);
    List<Cake> findByTypeOrderBySalesCountDesc(Type type);
    List<Cake> findByTypeAndDiscountPriceIsNotNull(Type type);
    List<Cake> findByNameContaining(String keyword);
}